import request from "@/utils/request";//不用加后缀.js

//查询全部部门数据
export const queryAllDepts = () => request.get('/depts');

//新增部门
//  dept 会作为请求体（body）的内容，发送通过post请求的方式提交给后端
export const addDepts = (dept) => request.post('/depts', dept);

//根据id查询部门
export const queryDeptById = (id) => request.get(`/depts/${id}`);

//更改部门名称
export const updateDept = (dept) => request.put('/depts', dept);

//删除部门
export const deleteDeptsById = (id) => request.delete(`/depts?id=${id}`);